<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<title>用户列表</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/pagejs.js"></script>
<script type="text/javascript">
/* $(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
 */
<%-- function deleteLab(labid){
 alert("===================");
   alert(labid);
   window.location.href="<%=basePath%>admin/deleteLaborary?laborary.labid="+labid;

  
} --%>
<%-- 
function updateLab(labid){
 alert(labid);
 alert(labid);
 window.location.href="<%=basePath%>admin/findLaboraryById.action?labid="+labid;
} --%>


</script>

<script type="text/javascript">
 $(function(){
               var level=sessionStorage.getItem("levels");
            $("#classes").val(level);
            });
</script>
<script type="text/javascript">
//删除记录
function checkdelete(userid){
var level=sessionStorage.getItem("levels");//获取session中角色ID区分管理员、实验技术员、教师,三个角色公用一个页面
if(confirm("确认删除这条记录吗"))
location.href="admin/deleteAdministrator?userid="+userid+"&pageing.classes="+level;
}

//修改记录
function checkupdate(userid){
var level=sessionStorage.getItem("levels");//获取session中角色ID区分管理员、实验技术员、教师
location.href="admin/findAdministratorById?userid="+userid+"&pageing.classes="+level;
}
</script>
</head>
<body>
    <form action="admin/pageAdministrator.action" method="post">
    	<input name="pageing.classes" id="classes" type="hidden" class="dfinput"/>
	<div class="place">
    <span>位置</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
<%--     <li>
    
  <s:if test="#session.levels=='3'">实验技术人员列表信息</s:if>
  <s:if test="#session.levels=='2'">教师列表信息</s:if>
  <s:if test="#session.levels=='1'">管理员列表信息</s:if>     
    </li> --%>
    </ul>
    </div>
    <div class="rightinfo">
    <div class="tools">
    	<ul class="toolbar">
    	<li class="click">
    	所属实验室:<input name="pageing.name" type="text" class="minput"/>
    	姓名:<input name="pageing.number" type="text" class="minput"/>
    	<input name="" type="submit" class="btn" value="查询"/></li>
        <li class="click"><a href="admin/adduserole.action"><span><img src="images/t01.png" /></span>添加</a></li>
        </ul>
        <ul class="toolbar1">
        </ul>
    </div>
     </form>
    <table class="tablelist">
    	<thead>
    	<tr>
        <th><input name="" type="checkbox" value="" checked="checked"/></th>
        <th>序号<i class="sort"><img src="images/px.gif" /></i></th>
        <th>用户名</th>
        <th>联系方式</th>
        <th>所属实验室</th>
        <th>角色</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <s:iterator value="pageingFinder.dataList" var="user" status="index">
        <tr>
        <td><input name="" type="checkbox" value="" /></td>
        <td><s:property value="#index.index+1"/></td>
        <td>${user.username}</td>
        <td>${user.phone}</td>
        <td>
        <s:iterator value="liLaborary" var="list" status="index">
         <s:if test='#list.labid==#user.laboraryid'>
		<option value="${list.labid}"selected="selected" >${list.labname}</option>
		</s:if>
		</s:iterator>
        </td>
        <td>${user.level}</td>
        <td>
         <input type="button" onclick="checkdelete(${user.userid})" value="删除"/>
        <input type="button" onclick="checkupdate(${user.userid})" value="修改"/>
        </td> 
        </tr> 
        </s:iterator>
        </tbody>
    </table>
   <form action="admin/pageAdministrator.action" id="pageForm">
   	<input name="pageing.classes" type="hidden" class="dfinput" value=""/>
       <div class="pagin">
    	<div class="message">共<i class="blue">${pageingFinder.rowCount}</i>页记录<i class="blue">当前第${pageingFinder.pageNo}/${pageingFinder.pageCount}</i>页</div>
        <ul class="paginList">
        <s:if test="pageingFinder.pageNo > 1">
        <li class="paginItem"><a href="javascript:first()"><span class="pagepre">首页</span></a></li>
        <li class="paginItem"><a href="javascript:previous()"><span class="pagenxt">上一页</span></a></li>
        </s:if>
         <s:if test="pageingFinder.pageNo < pageingFinder.pageCount">
        <li class="paginItem"><a href="javascript:next()"><span class="pagepre">下一页</span></a></li>
        <li class="paginItem"><a href="javascript:last()"><span class="pagenxt">尾页</span></a></li>
        </s:if>
       <li> 转到第
        <input id="inputPage" name="pageingFinder.pageNo" id="inputPage" type="text" />页
         <input type="hidden" id="hiddenPagge" value="${pageingFinder.pageCount }"/>
        <input name="" type="submit"  class="cancel" value="转" /></li>
        </ul>
    </div>
    </form>
    
   </div>
        
</body>

</html>